//
// Created by dgy on 2022/12/11.
//
#include <cmath>
#include "iostream"
#include "vector"
using namespace std;
    int majorityElement(vector<int> &nums){
        int dest;
        int count=0;
        for (int i = 0; i <nums.size() ; ++i) {
            if (count==0){
                dest=nums[i];
                count++;
            }else{
                dest==nums[i]?count++:count--;
            }
        }
        return dest;
    }
    int main(){
        vector<int> nums;
        nums.push_back(2);
        nums.push_back(3);
        nums.push_back(3);
        int dest=majorityElement(nums);
        cout<<dest<<endl;
    }